# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2017/11/7 10:18
# @Author  : wenwen
# @Site    : https://gitee.com/dimensiva/app_server.git
# @File    : md5.py
# @Software: PyCharm
# @Version: 3.5.4
import hashlib

def createMd5(passWorld,randomkey):
    md5Str = __getMd5(passWorld)
    return __getMd5(md5Str+randomkey)


def __getMd5(source):
    m5 = hashlib.md5()
    m5.update(source)
    return m5.hexdigest()


def encode_with_sha1(s):
	return hashlib.sha1(s.encode('utf-8')).hexdigest()


if __name__ == "__main__":
    # print createMd5("123456","UMUW462")
	print(encode_with_sha1('asadasdas'))